import Vue from 'vue';
import VueRouter, { RouteConfig } from 'vue-router';
import PortalIndex from '@/components/product-manager/product-list.vue';
import PortalDetial from '@/components/product-manager/product-detial.vue';
import Login from '@/components/auth/login.vue';
import Register from '@/components/auth/register.vue';
import Order from '@/components/orders/order-list.vue';
Vue.use(VueRouter);
const routes: Array<RouteConfig> = [
       {
            path: '/',
            name: 'PortalIndex',
            component: PortalIndex,
            meta: {
                title: '商城首页',
                keepAlive: false,
            }
      },
      {
            path: '/portalDetial',
            name: 'PortalDetial',
            component: PortalDetial,
            meta: {
                keepAlive: false,
                title:"商品详情"
            }
        },
        {
            path: '/myOrder',
            name: 'Order',
            component: Order,
            meta: {
                keepAlive: false,
                title:"订单列表"
            }
        },
        {
            path: '/login',
            name: 'Login',
            component: Login,
            meta: {
                keepAlive: false,
                title:"登录页面"
            }
        },
        {
            path: '/register',
            name: 'Register',
            component: Register,
            meta: {
                keepAlive: false,
                title:"注册页面"
            }
        }
]

const router = new VueRouter({
      mode: 'history',
      routes
})

export default router
